package cpr.context;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import cpr.Rule;

public class CacheRuleContext {
	Map map = new HashMap();
	
	public boolean containsAll(Collection globalRuleNrs) {
		return map.keySet().containsAll(globalRuleNrs);
	}
	
	public boolean contains(int globalRuleNr) {
		return map.containsKey(Integer.valueOf(globalRuleNr));
	}
	public void setRule(Rule aRule) {
		map.put(Integer.valueOf(aRule.ruleNrGlobal), aRule);
	}
	public Rule getRule(int globalRuleNr) {
		return (Rule)map.get(Integer.valueOf(globalRuleNr));
	}
	public void clear() {
		map.clear();
	}
}
